import { defineComponent } from "vue"
import { useFuncEmit } from "@/utils/vueHelper"

const PropsType = {
  age: {
    type: Number,
    required: true
  }
}
const consoleLog = () => {
  console.log("11111")
}
export default defineComponent({
  props: PropsType,
  setup(props, { slots }) {
    return () => {
      useFuncEmit(Instance => {
        Instance.consoleLog = consoleLog
      })
      return (
        <div onClick={consoleLog}>
          <div>{props.age}</div>
          <div>
            {slots.default && slots.default("haha")}
            {slots.age && slots.age("23")}
          </div>
        </div>
      )
    }
  }
})
